vulkan: Fix border shader to premultiply color
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Dec 2017 13:32:38 +0000 (14:32 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 2 Dec 2017 15:21:58 +0000 (16:21 +0100)
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.

gsk/resources/vulkan/border-clip-rounded.frag.spv
gsk/resources/vulkan/border-clip.frag.spv
gsk/resources/vulkan/border.frag
gsk/resources/vulkan/border.frag.spv

index 690c02be05ad5375d1abfac52219f4b2b3d2434c..f60047f978134dfdefdaa1f61aaac5d6fd7d8e44 100644 (file)
Binary files a/gsk/resources/vulkan/border-clip-rounded.frag.spv and b/gsk/resources/vulkan/border-clip-rounded.frag.spv differ
index 1a3fda7d674c2c22673390ff18699cbda49b41d8..2fc1ca1dcb7d33fb0fb2ba1c5de6211ad5374599 100644 (file)
Binary files a/gsk/resources/vulkan/border-clip.frag.spv and b/gsk/resources/vulkan/border-clip.frag.spv differ
index 988b1f6f4a6c4b3cb027de26fa83a72c83891084..193ccfa6eb96a902f2de740cccb5efebcbb4196a 100644 (file)
@@ -20,5 +20,5 @@ void main()
   float alpha = clamp (rounded_rect_coverage (routside, inPos) -
                        rounded_rect_coverage (rinside, inPos),
                        0.0, 1.0);
-  color = clip (inPos, inColor * alpha);
+  color = clip (inPos, vec4(inColor.rgb * inColor.a, inColor.a) * alpha);
 }
index 1a3fda7d674c2c22673390ff18699cbda49b41d8..2fc1ca1dcb7d33fb0fb2ba1c5de6211ad5374599 100644 (file)
Binary files a/gsk/resources/vulkan/border.frag.spv and b/gsk/resources/vulkan/border.frag.spv differ